package array;

/**
 * @author 十八岁讨厌编程
 * @date 2025/6/27 21:01
 * @PROJECT_NAME leetcode
 * @description
 */

public class Solution27 {

    public int removeElement(int[] nums, int val) {
        int head = 0;
        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == val) {
                continue;
            }
            nums[head++] = nums[i];
            count++;
        }
        return count;
    }


}
